import QtQuick 2.2
import QtQuick.Controls 1.1

item {
    anchors.fill: parent

    ListView {
          id: dataView
          height: contentHeight
          anchors.fill: parent
          spacing: 2
          model: itemTreeModel
          delegate: ItemTreeDelegate{id:itemTreeDelegate}
    }
    ListModel {
        id:itemTreeModel
        ListElement {txt: 1;value: "first"; children:[]}
        ListElement {txt: 2;value: "second"; children:[
                ListElement {txt: 5;value: "second1.0"; children:[
                        ListElement {txt: 7;value: "second1.1"; children:[]},
                        ListElement {txt: 8;value: "second1.2"; children:[]}
                    ]},
                ListElement {txt: 6;value: "second2.2"; children:[]}
            ]}
        ListElement {txt: 3;value: "third"; children:[]}
        ListElement {txt: 4;value: "forth"; children:[]}



    }
}
